# 循环遍历字典一/
# 定义一个字典dict1，包含三个键值对
# 遍历就是依次从字典中获取所有键值对/
# dict1={"name":"刘备","age":32,"height":1.75}
#
# for n in dict1:
#     print("键的值是%s,值是%s" %(n,str(dict1[n])))


# 循环遍历字典二----拆包方式
# 字典的items方法获取字典中的键值对；
# dict1={"name":"刘备","age":32,"height":1.75}
# #n获取dict12中的每个键值对
# for n in dict1.items():
#         print(n)

# #定义一个字典dict1，包含三个键值对
dict1 = {"name": "刘备", "age": 32, "height": 1.75}
# #a为键， b为值
for a, b in dict1.items():
    print("键=%s，值=%s" % (a, str(b)))
